﻿<%@ page language="java" import="java.util.*,com.ruohi.util.common.*" pageEncoding="UTF-8"%><%
	String tableName = "gift_online_message";
	String tablePrefix = Env.getInstance().getProperty("table_prefix");
	String fileds = "id,add_date,uuid,type,content,link_man,link_phone";
	String channelUUID = CommonString.getFormatPara(request.getParameter("channel_uuid"));
	String whereStr = " ";
	String orderByStr = " id desc ";
	
	Map enumMap116 = (Map)CommonApplication.getEnumChildren("116",application);
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title><%=Env.getInstance().getProperty("project_name") %></title>
	<link href="/plugin/ui/ligerUI/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
	<link href="/plugin/ui/ligerUI/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
	<link href="/plugin/ui/ligerUI/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
	<link href="/backend/style/style.css" rel="stylesheet" type="text/css" />
	<script src="/plugin/jquery/jquery.min.js" type="text/javascript"></script>
  </head>
  <body>
  	<div class="searchForm">
  		<div class="searchCondition">
  			<div class="searchList">
		  		<div class="searchLeft">联系人</div>
		  		<div class="searchRight">
		  			<input type="text" class="jr_text" name="link_man" id="link_man" />
		  		</div>
		  	</div>
  			<div class="searchList">
		  		<div class="searchLeft">留言</div>
		  		<div class="searchRight">
		  			<input type="text" class="jr_text" name="content" id="content" />
		  		</div>
		  	</div>
		  	<div class="searchList">
		  		<div class="searchLeft">类型</div>
		  		<div class="searchRight">
		  			<select name="type" id="type" class="jr_select">
                    	<option value="">-选择类型-</option>
		  				<%=CommonForm.createSelect(enumMap116,"") %>
		  			</select>
		  		</div>
		  	</div>
            <div class="searchList">
		  		<div class="searchLeft">起始日期</div>
		  		<div class="searchRight">
		  			<input type="text" class="Wdate jr_text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" name="start_date" id="start_date" />
		  		</div>
		  	</div>
		  	<div class="searchList">
		  		 <div class="searchLeft">结束日期</div>
		  		<div class="searchRight">
		  			<input type="text" class="Wdate jr_text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" name="end_date" id="end_date" />
		  		</div>
		  	</div>
  		</div>
  		<div class="searchBtn">
  			<input type="button" class="btn" onclick="doSearch();" value="查询" /><input type="button" style="margin-left: 5px;" class="btn" onclick="doClearForm();" value="重置" />
  		</div>
  	</div>
  	<div style="clear: left;"></div>
  	
	<div class="l-loading" style="display: block" id="pageloading"></div> 
	<div id="maingrid" style="margin: 0; padding: 0"></div>
	<div style="display: none;"></div>
  </body>
</html>
<script src="/plugin/ui/ligerUI/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="/plugin/date/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="/backend/scripts/common.js" prefix="<%=tablePrefix %>" type="text/javascript"></script>
<script type="text/javascript">
	var grid;
	var windowWidth = 700;
	var windowHeight = 240;
	var channelUUID = '<%=channelUUID %>';
	var tableName = "<%=tableName %>";
	var fields = "<%=fileds %>";
	var whereStr = "<%=whereStr %>";
	var orderBy = "<%=orderByStr %>";
	var columnsArr = [];
	var url = "";
	var conditionStr = "";
	var params = [];
	jQuery(function() {
		params.push({'name':'enumNo','value':'106013'});
		grid = new Dev21sunGrid();
		jQuery("#pageloading").hide();
	});
	var is_showData = [{ is_show : 1 , text: '是' }, { is_show : 0 , text: '否'}];
	//列数组
	columnsArr =  [ 
		{ display : '类型', name : 'type', align : 'left' , type : 'string' , width : 150 , render : function(row){
				return getEnum(row.type,"enumMap");
			}
		} ,
		{ display : '内容', name : 'content', align : 'left' , type : 'string' , width : 500, render:function(row){
			return "<a class='link' href='javascript:void(0);' onclick='addAndEdit("+row.__index+");'>" + row.content + "</a>";
		} }  ,
		{ display : '联系人', name : 'link_man', align : 'center' , type : 'string' , width : 100 } ,
		{ display:"联系电话", name:"link_phone", align:"center", type:"string", width:150 },
		{ display : '日期', name : 'add_date', align : 'center' , type : 'date' , width : 100 }  
	];
	
	/*列表页条件查询*/
	function doSearch(){
		params = [];
		conditionStr = "";
		var content = jQuery("#content").val();
		if(''!=jQuery.trim(content)){
			conditionStr += " and content like '%"+content+"%' ";
		}
		var link_man = $.trim($("#link_man").val());
		if(link_man!=""){
			conditionStr += " and link_man like '%" + link_man + "%'";
		}
		var type = jQuery("#type").val();
		if(''!=jQuery.trim(type)){
			conditionStr += " and type = '"+type+"' ";
		}
		var start_date = jQuery("#start_date").val();
		if(''!=jQuery.trim(start_date)){
			conditionStr += " and add_date > '"+start_date+"' ";
		}
		var end_date = jQuery("#end_date").val() ;
		if(''!=jQuery.trim(end_date))
		{
		    conditionStr += " and add_date < '"+end_date+"'" ;
		}
		params.push({'name':'enumNo','value':'106013'});
		params.push({'name':'tableName','value':tableName});
		params.push({'name':'fileds','value':fields});
		params.push({'name':'whereStr','value':whereStr+conditionStr});
		params.push({'name':'orderBy','value':orderBy});
		grid.options.parms=params;
		grid.loadData();
	}
</script>